package com.bdsoft.actions.resourceManage.Dao;

import com.bdsoft.actions.resourceManage.DTO.ResourceDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface ResourceMapper {
    List<Map<String,Object>> selectResourceByParams(String resourceId, String resourceName);
    int addResource(ResourceDTO resourceDTO);
    int updateResourceById(ResourceDTO resourceDTO);
    int deleteResourceById(String resourceId);
    List<Map<String,Object>> selectResourceByRoleId(@Param("roleId") String roleId);
    int assignResourceToRole(@Param("roleId") String roleId, @Param("resourceId") String resourceId);
    int removeResourceFromRole(@Param("roleId") String roleId, @Param("resourceId") String resourceId);
    int removeResourceRoleById( @Param("resourceId") String resourceId);
}